package io.xxx.mario.robot;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface WechatyPuppetMapper extends BaseMapper<WechatyPuppet> {

    @Select("select * from wechaty_puppet where used = false limit 1")
    WechatyPuppet findByUsed(boolean used);

    @Update("update wechaty_puppet set used = true where id = #{id}")
    void useToken(@Param("id") Long id);
}
